process.env.NODE_ENV = 'production'
console.log('process.env.npm_package_name-->', process.env.npm_package_name)
console.log('process.env.npm_package_version-->', process.env.npm_package_version)
const webpack = require('webpack')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const merge = require('webpack-merge') 
const common = require('./webpack.config.js')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = merge(common, {
	output: {
		path: path.join(__dirname + '/dist'),
        filename: '[name].[hash:8].js', 
        publicPath: '/',
	},
	plugins: [
		new CleanWebpackPlugin(
			{
				root: path.resolve(__dirname, '/dist'), //根目录
				verbose: true, 
				dry: false 
			}
		),
		new HtmlWebpackPlugin({
			title: '慢病健康管理平台',
			template: 'index.html', 
            filename: path.resolve(__dirname, './dist/index.html'),
			hash: true,
			chunks: ['main'], 
			chunksSortMode: 'manual', 
			inject: 'body', 
			minify: false
		}),
		new webpack.HashedModuleIdsPlugin(),
		// enable scope hoisting
        new webpack.optimize.ModuleConcatenationPlugin(),
        
	],
	
})
